package cl.ccs.migracionbcmc.validators;


import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class Validator {
    public Validator() {
        super();
    }
    
    public static boolean match(String text, String pattern) {
        if ((null == text)) {
            return false;
        }
        Pattern p = Pattern.compile(pattern);
        Matcher m = p.matcher(text);
        return (m.matches());
    }
    
    public static boolean match(String text, String pattern, int modifier) {
        if ((null == text)) {
            return false;
        }
        Pattern p = Pattern.compile(pattern, modifier);
        Matcher m = p.matcher(text);
        return (m.matches());
    }
}
